//
//  User.m
//  runtimeTest
//
//  Created by Song on 2018/4/18.
//  Copyright © 2018年 Song. All rights reserved.
//

#import "User.h"

#import "Cat.h"

@implementation User
-(instancetype)initWithDict:(NSDictionary *)dict{
    if (self = [super init]) {
        self.name = dict[@"name"];
        self.age = [dict[@"age"] intValue];
        self.height = [dict[@"height"] doubleValue];
        
        self.cat = [[Cat alloc] initWithDict:dict[@"cat"]];
    }
    return self;
}

+(instancetype)userWithDict:(NSDictionary *)dict{
    return [[self alloc] initWithDict:dict];
}

//// 返回数组中都是什么类型的模型对象
//- (NSString *)arrayObjectClass {
//   return @"Book";
//}

@end
